<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>dog</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>欢迎页面</title>
		<script src="../js/jq3.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/mui.js"></script>
		<link href="../css/mui.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../css/common.css" />
		<script type="text/javascript" src="../js/dbManager.js"></script>
	</head>
	<body>

		<ul class="mui-table-view" id="tripList">


		</ul>

	</body>



</html>

<script type="text/javascript">
	// 
	var _path_doc = "/storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/doc/";

	document.addEventListener("plusready", function() {
		_path_doc = plus.storage.getItem("path_doc");
		initList();

	}, false);


	// 刷新图文列表
	function initList() {
		// 
		DBmanager.openDb();
		plus.sqlite.selectSql({
			name: DBmanager.name,
			sql: "select * from  trips order by id desc",
			success: function(res) {
				for (let i = 0; i < res.length; i++) {
					var trip = res[i];
					let template =
						`
					<li class="mui-table-view-cell mui-media">
						<a href="javascript:;">
							<img class="mui-media-object mui-pull-right" 
							src="${_path_doc}cameraxxx/${trip.pic}">
							<div class="mui-media-body">
								${trip.content}
								<p class='mui-ellipsis'>${trip.location}</p>
							</div>
						</a>
					</li>
					`;

					$("#tripList").append(template);

				}

			},
			fail: function(err) {}

		});
	}
</script>
